VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsSendEMail"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Public Sub SendErrorEmail(strErrorMsg As String)

Dim cJMail As clsJMail
Dim strEMailBody As String
Dim i As Integer

    On Error GoTo SendErrorEmailFix

     
        Set cJMail = New clsJMail
        
        ' Email Body
        strEMailBody = "Please be advised . . " & vbCrLf & vbCrLf
        strEMailBody = strEMailBody & vbCrLf
        strEMailBody = strEMailBody & strErrorMsg
        
        'Get mail settings
        cJMail.EMailServer = "trend1.liberty.co.za"
        cJMail.MsgFrom = "SARSDirResp.Receive@liberty.co.za"
        cJMail.MSGFromName = "SARS Directive Response"
        cJMail.MSGSubject = "KeyTax Directive Response Emailing Error"
        cJMail.MSGBody = strEMailBody
        cJMail.AddRecipient "info@keytax.co.za", "info@keytax.co.za"
        
        
        'Send Mail
        If Not cJMail.SendMSG Then
            'send email to one of us if we're not already on the distr list
            cJMail.EMailServer = "trend1.liberty.co.za"
            cJMail.MsgFrom = "SARSDirResp.Receive@liberty.co.za"
            cJMail.MSGFromName = "SARS Directive Response"
            cJMail.MSGSubject = "KeyTax Directive Response Emailing Error"
            cJMail.MSGBody = "Error: " & vbCrLf & strErrorMsg
            cJMail.SendMSG
        End If
        
        ' Cleanup
        Set cJMail = Nothing
    
 
    Exit Sub
    
SendErrorEmailFix:
    Err.Raise "SendErrorEmail : " & Err.Number & " - " & Err.Description
End Sub

